\(\int \cos (a+b x) \cot (c+d x) \, dx\) [254]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 13, antiderivative size = 130 \[ \int \cos (a+b x) \cot (c+d x) \, dx=-\frac {e^{-i (a+b x)}}{2 b}+\frac {e^{i (a+b x)}}{2 b}+\frac {e^{-i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,-\frac {b}{2 d},1-\frac {b}{2 d},e^{2 i (c+d x)}\right )}{b}-\frac {e^{i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,\frac {b}{2 d},1+\frac {b}{2 d},e^{2 i (c+d x)}\right )}{b} \]

[Out]

-1/2/b/exp(I*(b*x+a))+1/2*exp(I*(b*x+a))/b+hypergeom([1, -1/2*b/d],[1-1/2*b/d],exp(2*I*(d*x+c)))/b/exp(I*(b*x+
a))-exp(I*(b*x+a))*hypergeom([1, 1/2*b/d],[1+1/2*b/d],exp(2*I*(d*x+c)))/b

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4654, 2225, 2283} \[ \int \cos (a+b x) \cot (c+d x) \, dx=\frac {e^{-i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,-\frac {b}{2 d},1-\frac {b}{2 d},e^{2 i (c+d x)}\right )}{b}-\frac {e^{i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,\frac {b}{2 d},\frac {b}{2 d}+1,e^{2 i (c+d x)}\right )}{b}-\frac {e^{-i (a+b x)}}{2 b}+\frac {e^{i (a+b x)}}{2 b} \]

[In]

Int[Cos[a + b*x]*Cot[c + d*x],x]

[Out]

-1/2*1/(b*E^(I*(a + b*x))) + E^(I*(a + b*x))/(2*b) + Hypergeometric2F1[1, -1/2*b/d, 1 - b/(2*d), E^((2*I)*(c +
 d*x))]/(b*E^(I*(a + b*x))) - (E^(I*(a + b*x))*Hypergeometric2F1[1, b/(2*d), 1 + b/(2*d), E^((2*I)*(c + d*x))]
)/b

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2283

Int[((a_) + (b_.)*(F_)^((e_.)*((c_.) + (d_.)*(x_))))^(p_)*(G_)^((h_.)*((f_.) + (g_.)*(x_))), x_Symbol] :> Simp
[a^p*(G^(h*(f + g*x))/(g*h*Log[G]))*Hypergeometric2F1[-p, g*h*(Log[G]/(d*e*Log[F])), g*h*(Log[G]/(d*e*Log[F]))
 + 1, Simplify[(-b/a)*F^(e*(c + d*x))]], x] /; FreeQ[{F, G, a, b, c, d, e, f, g, h, p}, x] && (ILtQ[p, 0] || G
tQ[a, 0])

Rule 4654

Int[Cos[(a_.) + (b_.)*(x_)]*Cot[(c_.) + (d_.)*(x_)], x_Symbol] :> Int[I*(1/(E^(I*(a + b*x))*2)) + I*(E^(I*(a +
 b*x))/2) - I*(1/(E^(I*(a + b*x))*(1 - E^(2*I*(c + d*x))))) - I*(E^(I*(a + b*x))/(1 - E^(2*I*(c + d*x)))), x]
/; FreeQ[{a, b, c, d}, x] && NeQ[b^2 - d^2, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {1}{2} i e^{-i (a+b x)}+\frac {1}{2} i e^{i (a+b x)}-\frac {i e^{-i (a+b x)}}{1-e^{2 i (c+d x)}}-\frac {i e^{i (a+b x)}}{1-e^{2 i (c+d x)}}\right ) \, dx \\ & = \frac {1}{2} i \int e^{-i (a+b x)} \, dx+\frac {1}{2} i \int e^{i (a+b x)} \, dx-i \int \frac {e^{-i (a+b x)}}{1-e^{2 i (c+d x)}} \, dx-i \int \frac {e^{i (a+b x)}}{1-e^{2 i (c+d x)}} \, dx \\ & = -\frac {e^{-i (a+b x)}}{2 b}+\frac {e^{i (a+b x)}}{2 b}+\frac {e^{-i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,-\frac {b}{2 d},1-\frac {b}{2 d},e^{2 i (c+d x)}\right )}{b}-\frac {e^{i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,\frac {b}{2 d},1+\frac {b}{2 d},e^{2 i (c+d x)}\right )}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.67 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.83 \[ \int \cos (a+b x) \cot (c+d x) \, dx=\frac {e^{-i (a+b x)} \left (-1+e^{2 i (a+b x)}+2 \operatorname {Hypergeometric2F1}\left (1,-\frac {b}{2 d},1-\frac {b}{2 d},e^{2 i (c+d x)}\right )-2 e^{2 i (a+b x)} \operatorname {Hypergeometric2F1}\left (1,\frac {b}{2 d},1+\frac {b}{2 d},e^{2 i (c+d x)}\right )\right )}{2 b} \]

[In]

Integrate[Cos[a + b*x]*Cot[c + d*x],x]

[Out]

(-1 + E^((2*I)*(a + b*x)) + 2*Hypergeometric2F1[1, -1/2*b/d, 1 - b/(2*d), E^((2*I)*(c + d*x))] - 2*E^((2*I)*(a
 + b*x))*Hypergeometric2F1[1, b/(2*d), 1 + b/(2*d), E^((2*I)*(c + d*x))])/(2*b*E^(I*(a + b*x)))

Maple [F]

\[\int \cos \left (x b +a \right ) \cot \left (d x +c \right )d x\]

[In]

int(cos(b*x+a)*cot(d*x+c),x)

[Out]

int(cos(b*x+a)*cot(d*x+c),x)

Fricas [F]

\[ \int \cos (a+b x) \cot (c+d x) \, dx=\int { \cos \left (b x + a\right ) \cot \left (d x + c\right ) \,d x } \]

[In]

integrate(cos(b*x+a)*cot(d*x+c),x, algorithm="fricas")

[Out]

integral(cos(b*x + a)*cot(d*x + c), x)

Sympy [F]

\[ \int \cos (a+b x) \cot (c+d x) \, dx=\int \cos {\left (a + b x \right )} \cot {\left (c + d x \right )}\, dx \]

[In]

integrate(cos(b*x+a)*cot(d*x+c),x)

[Out]

Integral(cos(a + b*x)*cot(c + d*x), x)

Maxima [F]

\[ \int \cos (a+b x) \cot (c+d x) \, dx=\int { \cos \left (b x + a\right ) \cot \left (d x + c\right ) \,d x } \]

[In]

integrate(cos(b*x+a)*cot(d*x+c),x, algorithm="maxima")

[Out]

integrate(cos(b*x + a)*cot(d*x + c), x)

Giac [F]

\[ \int \cos (a+b x) \cot (c+d x) \, dx=\int { \cos \left (b x + a\right ) \cot \left (d x + c\right ) \,d x } \]

[In]

integrate(cos(b*x+a)*cot(d*x+c),x, algorithm="giac")

[Out]

integrate(cos(b*x + a)*cot(d*x + c), x)

Mupad [F(-1)]

Timed out. \[ \int \cos (a+b x) \cot (c+d x) \, dx=\int \cos \left (a+b\,x\right )\,\mathrm {cot}\left (c+d\,x\right ) \,d x \]

[In]

int(cos(a + b*x)*cot(c + d*x),x)

[Out]

int(cos(a + b*x)*cot(c + d*x), x)